<!--
 * @description  : 仓库-追加物品
 * @descriptionDetail: 仓库-追加物品
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-07-09 18:43:02
-->
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar :is-white="false" :title="navTitle" :custom-back="goBack" style="z-index: 99999"></theme-navbar>
    <!-- #endif -->
    <view class="content content-bg ifn-content u-padding-30" style="background-color: white;">
      <view class="u-flex search-lay">
        <view class="search-title">
          品种及规格
        </view>
        <view class="u-flex" style="width:71%">
          <view style="position: relative; padding-right: 20rpx;width: 100%;">
            <input
              style="position: absolute;top: 8px;left: 4px;"
              class="u-input__input"
              type="text"
              placeholder="请输入关键字"
              placeholderStyle="'color: #c0c4cc;'"
              :focus="scanOtherShow"
              confirmType="done"
              :cursor-spacing="0"
              :show-confirm-bar="true"
              v-show="scanOtherShow"
              id="scanOther"
              v-model="hideVal"
              @input="scanOtherInputEvent"
            />
            <u-input
              :custom-style="customStyle"
              placeholder="请输入关键字"
              :focus="focus"
              :disabled="scanOtherShow"
              v-model="searchTxt"
              @blur="searchBlur"
              @focus="searchFocus"
            >
            </u-input>
          </view>
        </view>
      </view>
      <u-line class="u-m-t-15 u-m-b-15 good-search-line" :color="$theme['u_border_color']"></u-line>
      <view
        class="good-search-lay"
        :style="{top: searchGoodTop,height: searchGoodHeight}"
        v-if="showSearchGoods"
        @touchstart="touchStart"
        @touchend="touchEnd"
      >
        <scroll-view scroll-y="true" :style="{height: searchGoodHeight}">
          <u-cell-group>
            <u-cell-item
              :titleStyle="{fontSize: '32rpx',}"
              :title="item.productName + ' ' + item.stripCode"
              :arrow="true"
              v-for="item in searchGoodList"
              :key="item.productUuid"
              @click="choiceGoodItem(item)"
            >
            </u-cell-item>
          </u-cell-group>
        </scroll-view>
      </view>
      <view :style="{height: getListHeight()}">
        <me-list
          :normalScrollView="false"
          :initiativeTap="true"
          :i="0"
          idKey="goodsRdmUuid"
          :limit="limit"
          :height="getListHeight()"
          :loadData="loadData"
          ref="mescrollRef0"
        >
          <view slot-scope="d">
            <view class="addr-bt">
              <view class="num-lay">
                <view class="num-title">
                  {{ getIndexByGoodsList(d.data.goodsRdmUuid) }}
                </view>
                <view class="num-content">
                  {{ d.data.productName }}
                </view>
              </view>
            </view>
            <view class="u-flex">
              <view class="u-flex-1 pty-lay">
                <view>入库数量（条）：</view>
                <good-input
                  type="digit"
                  class="u-m-l-20 u-m-r-20"
                  :customStyle="cusStyle"
                  inputAlign="right"
                  placeholder="请输入"
                  :extStr="d.data.goodsRdmUuid"
                  v-model="d.data.qty"
                  @input="inputQtyEvent"
                  @blur="BlurQtyEvent"
                ></good-input>
                <view>条</view>
              </view>
            </view>
            <u-form-item
              label-width="auto"
              label-position="left"
              :label-style="labelStyle"
              class="u-m-l-20"
              label="当前时间:"
              v-if="status != 'add'"
            >
              <u-input placeholder="当前时间" inputAlign="right" :disabled="true" :clearable="false" v-model="d.data.createTime">
              </u-input>
            </u-form-item>
            <u-form-item
              label-width="auto"
              label-position="left"
              :label-style="labelStyle"
              class="u-m-l-20"
              label="当事人:"
            >
              <u-input placeholder="请输入" inputAlign="right" :clearable="false" v-model="d.data.party">
              </u-input>
            </u-form-item>
            <u-form-item label-width="auto" :label-style="labelStyle" class="u-m-l-20" label="性质大类:">
              <dic-input
                :keyWord="$u.dic.DIC_KEYS.GOODS_PROP_TYPE"
                :dicCode="d.data.propType"
                :border="false"
                inputAlign="right"
                type="select"
                :select-open="dicSelectOpen($u.dic.DIC_KEYS.GOODS_PROP_TYPE)"
                placeholder="请选择"
                :timeKey="d.data.goodsRdmUuid"
                v-model="d.data.propTypeName"
                @changeInputModelData="(name)=>{$set(d.data, 'propTypeName', name)}"
                @click="showDic($u.dic.DIC_KEYS.GOODS_PROP_TYPE,d.data.propType,d.data.goodsRdmUuid)"
              />
            </u-form-item>
            <u-form-item label-width="auto" :label-style="labelStyle" class="u-m-l-20" label="性质小类:">
              <dic-input
                :keyWord="$u.dic.DIC_KEYS.GOODS_PROP_SUBTYPE"
                :dicCode="d.data.propSubtype"
                :border="false"
                inputAlign="right"
                type="select"
                :select-open="dicSelectOpen($u.dic.DIC_KEYS.GOODS_PROP_SUBTYPE)"
                placeholder="请选择"
                :timeKey="d.data.goodsRdmUuid"
                v-model="d.data.propSubtypeName"
                @changeInputModelData="(name)=>{$set(d.data, 'propSubtypeName', name)}"
                @click="showDic($u.dic.DIC_KEYS.GOODS_PROP_SUBTYPE,d.data.propSubtype,d.data.goodsRdmUuid)"
              />
            </u-form-item>
          </view>
        </me-list>
      </view>
    </view>
    <view class="submit-btns btn-other-cls">
      <u-button class="u-btn" type="primary" @click="confirm">
        确定
      </u-button>
    </view>
    <dic-choice
      :keyWord="dicKeyWords"
      :currentSelect="dicCurrentSelect"
      v-model="dicShow"
      @confirm="selectDicConfirm"
    ></dic-choice>
    <u-mask :show="scanOtherShow" @click="hideMask">
      <view class="warp" style="text-align: center;">
        数据录入中,请勿触屏<br>触屏将结束录入
      </view>
    </u-mask>
  </view>
</template>

<script>
import mescrollList from "@/components/mescroll_list.vue";
import DicChoice from "@/components/dic_choice.vue";
import DicInput from "@/components/dic_input.vue";
import caseService from "@/service/case/case.service";
import goodInput from "./goodInput.vue";
import storeService from '@/service/store/store.service.js';
import {
  v4 as uuidv4,
} from 'uuid';
export default {
  components: {
    "me-list": mescrollList,
    "dic-choice": DicChoice,
    "dic-input": DicInput,
    goodInput,
  }, //
  data() {
    return {
      user: this.$storage.get(this.$rp.common.USER),
      limit: 5,
      hideVal: "",
      dicShow: false, // dic_select 是否显示
      dicKeyWords: "", // dic 关键字
      dicCurrentSelect: "", // dic 当前选择项
      currIndex: 0,
      searchTxt: "",
      labelStyle: {
        fontSize: '30rpx',
      },
      customStyle: {
        backgroundColor: this.$theme['u_bg_color'],
        borderRadius: '20px',
        paddingLeft: '10px',
        paddingRight: '10px',
      },
      cusStyle: {
        color: '#FF943E',
      },
      dataList: [],
      showSearchGoods: false,
      searchFlag: false, // 快慢问题
      searchGoodList: [],
      searchGoodTop: "",
      searchGoodHeight: "",
      preObj: {}, // 上一次的数据, 用于给下一次新增的数据填充默认值
      choiceMergeList: [],
      choiceMergeShow: false,
      focus: false,
      defaultWindowHeight: this.$u.sys().windowHeight,
      showSoftInputView: false,
      tmpChoice: undefined,
      scanOtherShow: false, //  扫码枪状态
      scanOtherData: {}, // 扫码的到的数据集合
      addFrom: "search", // 默认 search  scanBar  infraredScan
      scanVal: undefined,
      taskSubject: "",
      baseInfo: {},
      status:'', // 区分状态
    }
  },
  computed: {
    realDataList() {
      let tmpList = this.dataList.filter(item => {
        return true;
      });
      tmpList.reverse();
      return tmpList;
    },
  },
  watch: {
    searchTxt(newVal, oldVal) {
      this.$u.debounce(this.getSearchGoodList, 500);
    },
  },
  onLoad (opt) {
    let opo = this.getRouteParam();
    if (opt.status == 'add') {
      this.status = 'add';
      let tmpList = opo;
      if (tmpList) {
        tmpList = this.$u.deepClone(tmpList);
        tmpList.forEach(item => {
          item.goodsRdmUuid = uuidv4();
          this.$set(item,'productName',item.goodsName)
          this.$set(item,'productUuid',item.goodsUuid)
          this.$set(item,'propSubtype',item.propSubType)
        });
        this.dataList = [...tmpList,];
      }
    } else {
      this.baseInfo = opo;
    }
  },
  mounted() {
    this.init();
  },
  onUnload() {
    uni.offWindowResize(() => {
      console.log('取消监听窗口尺寸变化事件')
    })
  },
  methods: {
    getListHeight() {
      return (this.$u.sys().windowHeight - 50 - 60 - 44 - uni.upx2px(120) - this.$u.sys().statusBarHeight) + "px";
    },
    getGoodSearchPopupHeight() {
      this.$u.getRect('.good-search-line').then(res => {
        this.searchGoodTop = res.bottom + "px";
        this.searchGoodHeight = (this.$u.sys().windowHeight - res.bottom - this.$u.sys()
          .statusBarHeight) + "px";
      });
    },
    getIndexByGoodsList(id) {
      for (let i = 0; i < this.realDataList.length; i++) {
        if (this.realDataList[i].goodsRdmUuid == id) {
          return this.realDataList.length - i;
        }
      }
      return -1;
    },
    init() {
      let self = this;
      this.getGoodSearchPopupHeight();
      if (this.dataList.length > 0) {
        this.updatePreObj(this.dataList[this.dataList.length - 1]);
      } else {
        this.preObj = undefined;
      }
      uni.onWindowResize((res) => {
        if (this.defaultWindowHeight - res.size.windowHeight > 180) { // 阈值 超过这个值表示软键盘弹出了
          this.showSoftInputView = true;
        } else { // 否则软键盘收起了
          this.showSoftInputView = false;
          if (this.searchFlag) return;
          if (this.tmpChoice) {
            this.showSearchGoods = false;
            this.choiceGoodItem(this.tmpChoice);
            this.tmpChoice = undefined;
          }
        }
      });
    },
    updatePreObj(obj) {
      this.preObj = {
        unitQty: obj.unitQty,
        seqnum: obj.seqnum,
        propSubtype: obj.propSubtype,
        propType: obj.propType,
        qty: obj.qty,
        createTime: obj.createTime,
        party: obj.party,
        propTypeName: obj.propTypeName,
        propSubtypeName: obj.propSubtypeName,
      };
    },
    hasMustPreIsEmpty() {
      return false;
    },
    searchBlur(e) {
      setTimeout(() => {
        console.log('==searchBlur==');
        if (!this.showSoftInputView && !this.searchFlag) {
          this.showSearchGoods = false;
        }
      }, 100);
    },
    touchStart(e) {
      console.log('==touchStart==');
      this.searchFlag = true;
    },
    touchEnd(e) {
      console.log('==touchEnd==');
      this.searchFlag = false;
    },
    searchFocus(e) {
      if (!this.$u.test.isEmpty(this.searchTxt)) {
        this.searchFlag = false;
        this.showSearchGoods = true;
      }
    },
    /*
			 * 条码查询
			 * */
    scanClick() {
      // #ifdef H5-DINGDING || H5-WECHAT
      this.$deviceApi.barCode().then(res => {
        this.$modal.showLoading("查询中...")
        caseService.searchByCode(res).then(
          res1 => {
            this.$modal.hideLoading();
            if (res1.success && res1.data && res1.data.length > 0) {
              this.addFrom = "scanBar";
              this.scanVal = res;
              this.choiceGoodItem(res1.data[0]);
            } else {
              this.$u.toast('未查询到该物品');
            }
          }).catch(e => {
          this.$modal.hideLoading();
        });
      }).catch(err => {
        this.$u.toast('扫描失败');
      });
      // #endif
    },
    /**
			 * 扫码枪扫码
			 * @param {Object} ev
			 * @param {Object} str
			 */
    scanOther() {
      this.scanOtherData = {};
      this.scanOtherShow = !this.scanOtherShow;
      this.$el.querySelector('#scanOther input').setAttribute('inputmode', 'none');
      this.focus = !this.scanOtherShow;
      setTimeout(() => {
        this.$el.querySelector('#scanOther input').removeAttribute('inputmode');
      }, 100);
      this.searchTxt = "";
    },
    scanOtherInputEvent(e) {
      let tmpStr = e.detail.value;
      if (tmpStr.length < 13) return;
      tmpStr = tmpStr.substr(tmpStr.length - 13);
      // TODO 接口请求
      caseService.searchByCode(tmpStr).then(
        res => {
          this.$modal.hideLoading();
          if (res.success && res.data && res.data.length > 0) {
            this.addFrom = "infraredScan";
            this.scanVal = tmpStr;
            this.choiceGoodItem(res.data[0]);
          } else {
            this.$u.toast('未查询到该物品');
          }
        }).catch(e => {
        this.$modal.hideLoading();
      });
      this.$nextTick(function() {
        this.hideVal = '';
      });
    },
    hideMask() {
      this.scanOtherShow = false;
      this.hideVal = "";
    },
    BlurQtyEvent(ev, str) {
      for (let i = 0; i < this.dataList.length; i++) {
        if (this.dataList[i].goodsRdmUuid == str) {
          if (Number(this.dataList[i].qty) < 0) {
            this.dataList[i].qty = 0;
            this.dataList[i].money = 0;
          }
          return;
        }
      }
    },
    inputQtyEvent(ev, str) {
      for (let i = 0; i < this.dataList.length; i++) {
        if (this.dataList[i].goodsRdmUuid == str) {
          try {
            let n = this.dataList[i].qty * this.dataList[i].price;
            this.dataList[i].money = Number(Number(n).toFixed(2));
          } catch (err) {
            console.log(err);
          }
          return;
        }
      }
    },
    inputPriceEvent(ev, str) {
      for (let i = 0; i < this.dataList.length; i++) {
        if (this.dataList[i].goodsRdmUuid == str) {
          try {
            let n = this.dataList[i].qty * this.dataList[i].price;
            this.dataList[i].money = Number(Number(n).toFixed(2));
          } catch (err) {
            console.log(err);
          }
          return;
        }
      }
    },
    choiceGoodItem(obj) {
      this.tmpChoice = undefined;
      this.searchFlag = false;
      this.searchTxt = '';
      if (!this.showSoftInputView) {
        this.showSearchGoods = false;
      } else {
        this.tmpChoice = obj;
        return;
      }
      this.$nextTick(function() {
        this.addNewItem(obj);
      })
    },
    updateDataContent(e) {
      for (let i = 0; i < this.dataList.length; i++) {
        if (this.dataList[i].goodsRdmUuid == e.goodsRdmUuid) {
          this.dataList[i].qty = Number(this.dataList[i].qty) + 1;
          this.dataList[i].money = Number(Number(this.dataList[i].qty * this.dataList[i].price).toFixed(2));
          break;
        }
      }
    },
    choiceMerge(e) {
      // 根据选中项 将列表调整到指定项位置 并给数量加一，总价格自动变更
      let pos = -1;
      for (let i = 0; i < this.realDataList.length; i++) {
        if (e.goodsRdmUuid == this.realDataList[i].goodsRdmUuid) {
          pos = i;
          break;
        }
      }
      if (pos == -1) return;
      let page = 0;
      if (pos % this.limit == 0) { // 表示整除了
        page = pos / this.limit;
      } else {
        page = Number(Number(pos / this.limit).toFixed(0)) + 1;
      }
      page = page + 1;
      this.updateDataContent(e);
      if (!this.$refs['mescrollRef0'].setPageNum(page)) {
        this.$refs['mescrollRef0'].scrollToViewItem(e.goodsRdmUuid)
      } else {
        this.$refs['mescrollRef0'].toCurrentPageData(e.goodsRdmUuid);
      }
      this.choiceMergeShow = false;
    },
    addNewItem(obj) {
      if (this.realDataList.length > 0) {
        this.updatePreObj(this.realDataList[0]);
      } else {
        if (this.dataList.length > 0) {
          this.updatePreObj(this.dataList[this.dataList.length - 1]);
        }
      }
      let tmp = {};
      if (this.preObj) tmp = this.$u.deepClone(this.preObj);
      tmp.goodsRdmUuid = uuidv4(); // 前端页面用到
      tmp.propTypeName = this.getDicName(this.$u.dic.DIC_KEYS.GOODS_PROP_TYPE, tmp.propType);
      tmp.propSubtypeName = this.getDicName(this.$u.dic.DIC_KEYS.GOODS_PROP_SUBTYPE, tmp.propSubtype);
      tmp.productUuid = obj.productUuid;
      tmp.productName = obj.productName;
      tmp.qty = obj.qty;
      // tmp.party = obj.party;
      tmp.unit = obj.defaultUnitName;
      tmp.price = obj.wholeSalePrice || 0;
      tmp.unitQty = obj.defaultUnitQty;
      if (this.addFrom == 'scanBar' || this.addFrom == 'infraredScan') {
        if (this.scanVal != undefined && this.scanVal == obj.packCode) {
          tmp.qty = 0.1; // 包码 返回0.1条
        } else if (this.scanVal != undefined && this.scanVal == obj.partCode) {
          tmp.qty = 50; // 一件=50条
        } else { // 条码
          tmp.qty = 1;
        }
      } else {
        tmp.qty = 1;
      }

      try {
        let n = tmp.qty * tmp.price;
        tmp.money = Number(Number(n).toFixed(2));
      } catch (e) {
        console.log(e);
        tmp.money = 0;
      }
      this.dataList.push(tmp);
      this.$refs['mescrollRef0'].resetList(false);
    },
    getDicName(keyword, code) {
      return this.$u.dic.getDicNameByKeyCode(keyword, code);
    },
    getSearchGoodList() {
      if (this.$u.test.isEmpty(this.searchTxt)) return;
      let param = {
        limit:20,
        page:1,
      };
      if(!this.$u.test.isEmpty(this.searchTxt)){
        param.productName = this.searchTxt;
      }
      storeService.purSearchList(param).then(
        res => {
          if (res.success) {
            this.addFrom = "search";
            this.scanVal = undefined;
            if (res.data.length == 1) {
              this.choiceGoodItem(res.data[0]);
            } else if (res.data.length > 1) {
              this.searchGoodList = [...res.data,];
              this.searchFlag = false;
              this.showSearchGoods = true;
            }
          }
        });
    },
    mergeData(cb) {
      this.$modal.showLoading('正在合并数据...');
      let p = new Promise((resolve, reject) => {
        let tmpList = this.$u.deepClone(this.dataList);
        let mergeObj = {};
        tmpList.forEach(itm => {
          // goodsRegUuid 加上的原因是 有值表示该数据一被使用不能再操作了
          let keys = itm.productUuid + '&' + itm.productName + '&' + itm.propSubtype + '&' + itm.propType + '&' + itm.party
          if (mergeObj[keys]) {
            let tmp = mergeObj[keys];
            tmp.push(itm);
          } else {
            let tmp = [];
            tmp.push(itm);
            mergeObj[keys] = tmp;
          }
        });
        let newGoodList = [];
        try {
          for (let k in mergeObj) {
            let ar = mergeObj[k];
            let op;
            for (let i = 0; i < ar.length; i++) {
              if (i == 0) {
                op = ar[i];
                try {
                  op.qty = Number(op.qty);
                  op.price = Number(op.price);
                } catch (er) {
                  op.qty = 0;
                  op.price = 0;
                }
              } else {
                try {
                  op.qty += Number(ar[i].qty);
                  op.money = op.qty * Number(op.price);
                } catch (er) {
                  op.qty = 0;
                  op.money = 0;
                }
              }
            }
            if (op) newGoodList.push(op);
          }
        } catch (e) {
          console.log(e);
          newGoodList = [];
        }
        resolve(newGoodList);
      });
      p.then(res => {
        this.$modal.hideLoading();
        if (res.length == 0 && this.dataList.length > 0) {
          // 则表示合并出错了
          this.$u.toast('合并出错了');
          return;
        }
        this.dataList = [...res,];
        cb && cb();
      });
    },
    confirm: function() {
      for (let i = 0; i < this.realDataList.length; i++) {
        let tmp = this.realDataList[i];
        if (this.$u.test.isEmpty(tmp.qty)  ||
						this.$u.test.isEmpty(tmp.party) ||
						this.$u.test.isEmpty(tmp.propSubtype) ||
						this.$u.test.isEmpty(tmp.propType)
        ) {
          this.$modal.alert(`【数据${this.realDataList.length - i} ${tmp.productName}】记录有数据为空？`);
          return;
        }
      }
      this.mergeData(() => {
        this.saveGoods();
      });
    },
    saveGoods () {
      let list = [];
      this.dataList.forEach(item => {
        let obj = {}
        obj = {
          createTime: "",
          goodsName: item.productName,
          goodsUuid: item.productUuid,
          party: item.party,
          propSubType: item.propSubtype,
          propSubtypeName: item.propSubtypeName,
          propType: item.propType,
          propTypeName: item.propTypeName,
          qty: item.qty,
          unit:item.unit,
        }
        list.push(obj)
      })
      if (this.status == 'add') {
        this.backPrev({
          paramKey: "goodData",
          param: list,
        });
      } else {
        let param = { ...this.baseInfo, custodyDtlList: list, }
        this.$modal.showLoading('提交中...');
        storeService.addMoreGoods(param).then(res => {
          if (res.success) {
            this.$modal.hideLoading();
            this.backPrev({
              paramKey: "goodData",
              param: list,
            });
          } else {
            this.$modal.hideLoading();
            console.log(res)
          }
        }).catch(err => {
          this.$modal.hideLoading();
          console.log(err)
        })
      }
    },
    loadData(page, isNeedRefresh, isSplice) {
      return new Promise((resolve, reject) => {
        if (this.realDataList.length > (page.size * (page.num - 1))) {
          let s = (page.size * (page.num - 1));
          let len = this.realDataList.length - s;
          if (len > page.size) {
            resolve({
              data: this.realDataList.slice(s, s + page.size),
              totalCount: this.realDataList.length,
            });
          } else {
            if (isSplice) { // 主动拼接上一页的数据 补足limit
              let lep = page.size - (this.realDataList.length - s);
              resolve({
                data: [...this.realDataList.slice(s - lep, s), ...this.realDataList
                  .slice(s),
                ],
                totalCount: this.realDataList.length,
                isSplice: isSplice,
              });
            } else {
              resolve({
                data: this.realDataList.slice(s),
                totalCount: this.realDataList.length,
              });
            }
          }
        } else {
          resolve({
            data: [],
            totalCount: 0,
          });
        }
      });
    },
    dicSelectOpen: function(keyWord) {
      if (this.dicKeyWords == keyWord && this.dicShow) {
        return true;
      } else if (this.dicKeyWords == keyWord && this.dicShow) {
        return true;
      } else if (this.dicKeyWords == keyWord && this.dicShow) {
        return true;
      }
      return false;
    },
    showDic: function(key, cur, id) {
      if (this.dicShow) return;
      this.dicKeyWords = key;
      this.dicCurrentSelect = cur;
      this.dicShow = true;
      this.currIndex = id;
    },
    selectDicConfirm: function(e) {
      let obj;
      let tmpList = this.realDataList.filter(itm => {
        if (itm.goodsRdmUuid == this.currIndex) return true;
        return false;
      });
      if (tmpList.length > 0) {
        obj = tmpList[0];
      }
      if (obj == undefined) return;
      if (this.dicKeyWords == this.$u.dic.DIC_KEYS.GOODS_PROP_TYPE) {
        obj.propTypeName = e[0].label;
        obj.propType = e[0].extra.bcbCode
      }else if (this.dicKeyWords == this.$u.dic.DIC_KEYS.GOODS_PROP_SUBTYPE) {
        obj.propSubtypeName = e[0].label;
        obj.propSubtype = e[0].extra.bcbCode
      }
    },

  },
}
</script>
<style lang="scss" scoped>
	.page {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
    padding: 0;

		.content {
			//height: 200vh;
			height: calc(100% - 44px);
			height: calc(100% - 44px - constant(safe-area-inset-top));
			height: calc(100% - 44px - env(safe-area-inset-top));
		}

		.content-padding {
			padding-left: 32rpx;
			padding-right: 32rpx;
		}

		.content-bg {
			background-color: $u-bg-color;
		}

		.slot-wrap {
			display: flex;
			align-items: center;
		}

		.navbar-right {
			margin-right: 24rpx;
			display: flex;
			color: $u-type-primary;
		}

		.right-item {
			margin: 0 12rpx;
			position: relative;
			color: $u-main-color;
			display: flex;
		}
	}

	.m-flex-row {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	.space-content {
		height: 150rpx;
	}

	.flat-btn {
		position: fixed;
		bottom: 50rpx;
		margin: auto;
		left: 60rpx;
		right: 60rpx;
		height: 46px;
		z-index: 999;
	}

	.m-font-weight-500 {
		font-weight: 500;
	}

	// 固定底部按钮
	.bottom-btn-info {
		position: fixed;
		bottom: 5px;
		right: 0;
		left: 0;
		z-index: 999;
	}

	.theme-color {
		color: $u-type-primary;
		margin-right: 30rpx;
	}

	.white-color {
		color: white;
		margin-right: 30rpx;
	}

	// 表单样式
	.main-content {
		margin: 0 15px 10px 15px;

		.main-title {
			font-size: 20px;
			margin: 20px 0 5px 0;
			;
		}

		//表单文本内容居右显示
		.form-content {
			margin-bottom: 60px;
		}

		// 承办人样式
		.person-info {
			width: 100%;

			.p-title {
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;

				.doc-sub-required {
					position: absolute;
					left: -8px;
					vertical-align: middle;
					color: #fa3534;
					padding-top: 3px;
				}

				.uicon-sty {
					color: $u-type-primary;
					padding-left: 10px;
				}
			}

			.p-content {
				.p-width {
					// width: 20%;
					display: inline-block;
				}

				.p-space-left {
					padding-left: 40px;
				}
			}
		}
	}

  // 页面底部按钮样式
  .submit-btns {
    display: flex;
    position: fixed;
    bottom: 40rpx;
    padding-left: 40rpx;
    padding-right: 40rpx;
    width: 100%;
    text-align: center;
    z-index: 999;

    .del {
      flex: 1;
    }

    .mit {
      flex: 1;
      margin-left: 40rpx;
    }
  }

  .btn-other-cls {
    padding-top: 20rpx;
    position: fixed;
    bottom: 0;
    padding-bottom: 20rpx;
    background-color: white;
    border-top: 1px solid $u-border-color;
  }

	.inline-box {
		display: flex;
		align-items: center;
	}

	.loc-box {
		line-height: 38px;
		padding: 11px 0;
		font-size: 15px;
		color: #303133;
	}

	// 添加、编辑页面标题样式
	.content {
		.party-info-content {
			padding: 10px 16px 16px;

			.party-info-title {
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
s
				.p-title-text {
					font-size: $font_size_1;
					font-weight: bold;
				}
			}

		}
	}

	.party-info-box {
		.text-right {
			text-align: right !important;
		}
	}

	.top-title-content {
		text-align: center;
		margin: 20px 0;

		.main-title {
			color: #000000;
			font-size: 18px;

			input {
				text-align: center;
				color: #000;
				font-weight: 600;
			}
		}

		.sub-title {
			font-size: 15px;
			margin: 3px;
		}

		.content-detail {
			margin: 3px;
		}
	}

	.audit-box {
		padding-bottom: 60px;
	}

	.audit-content {
		margin: 15px;

		.audit-title {
			text-align: center;
			font-weight: 600;
			padding: 0px 6px 10px 6px;
			border-bottom: 1px solid #f2f2f2;
		}

		.audit-text {
			padding: 10px 0;
			border-bottom: 1px solid #f2f2f2;
		}

		.audit-person {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
		}

		.audit-require {
			vertical-align: middle;
			color: #fa3534;
			padding-top: 3px;
			padding-right: 3px;
		}
	}

	uni-page-body {
		height: 100%;
	}

	.sub-title-lay {
		height: 60px;

		.sub-title {
			font-size: .65rem;
			color: $u-tips-color;
		}

		text {
			font-size: 1.2rem;
			font-weight: 500;
		}
	}

	.search-lay {
		height: 50px;

		.search-title {
			font-size: 32rpx;
			font-weight: 500;
      padding-right: 30rpx;
		}

	}

	.flat-bottom {
		position: fixed;
		bottom: 0;
		margin: auto;
		z-index: 88;
		height: 180rpx;
		left: 0;
		right: 0;
		background-color: white;
	}

	.flat-line {
		margin-top: 10rpx;
		margin-bottom: 10rpx;
	}

	.num-lay {
		height: 40px;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		margin-top: 10px;
	}

	.num-title {
		border-radius: 50%;
		background-color: $u_border_color;
    width: 40rpx;
    height: 40rpx;
    line-height:40rpx;
    text-align:center;
    margin: 0 20rpx 0 20rpx;
	}

	.num-content {
		color: #222;
		font-size: .8rem;
		font-weight: bold;
	}

	.pty-lay {
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 10rpx 0rpx;
		margin: 0rpx 20rpx;
		border-bottom: 1px solid $u-border-color;
	}

	.price-lay {
		display: flex;
		flex-direction: row;
		align-items: center;
		padding: 10rpx 10rpx;
		margin: 0rpx 10rpx;
		border-bottom: 1px solid $u-border-color;
	}

	.pop-content {
		padding: 24rpx;
		touch-action: none;
	}

	.m-input {
		margin: 0 10rpx;
	}

	.pop-item {
		font-size: 14px;
		padding: 10px 10px;
		border-bottom: 1rpx solid #EEEEEE;
	}

	.good-search-lay {
		width: 100%;
		margin-left: -30rpx;
		z-index: 199;
		position: absolute;
		background-color: white;
	}

	.warp {
		font-size: 40rpx;
		color: white;
		font-weight: bold;
		display: flex;
		justify-content: center;
		align-self: center;
		height: 100%;
		flex-direction: column;
	}
  .addr-bt{
  display: flex;
  flex-direction: row;
  align-items: center;
  align-content: center;
  justify-content: space-between;
}
.part-right {
  font-size: 30rpx;
  font-weight: 600;
	color: $u-type-warning;
  padding-right: 10px;
  margin-top: 10px;
}
</style>
